package com.zxw.设计模式.设计原则.里氏替换;

/**
 * @projectName: util-cloud
 * @package: com.zxw.设计模式.设计原则.里氏替换
 * @className: Test
 * @author: zhangxuewei
 * @description: TODO
 *
 * @date: 2023/4/24 16:39
 * @version: 1.0
 */
public class Test {
    public static void main(String[] args) {
        Context context = new Context();
        context.setStrategy(new PromotionalStrategy());
        double res =  context.cul(1000);// cul方法可以做前置、后置处理
        System.out.println(res);

        Istrategy is = new PromotionalStrategy();
        double res2 =  is.realPrice(1000);
        System.out.println(res2);
    }
}
